home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-16 | 1.2 KB | 34 lines | [TEXT/GEOL] |
- Item 0462746 10-April-90 09:46PDT
-
- From: ALGER Alger, Jeff,VCA
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: RE>C++ use of Catchfailur
-
- Wouldn't the world of failure handling be a LOT simpler if the "fi" argument to
- CatchFailures were made an object, whose methods could be overridden? The
- interface could look something like this:
-
- TFailInfo = OBJECT (TObject)
- fFi: FailInfo; { although I would rather see this broken out! }
- PROCEDURE TFailInfo.CatchFailures;
- PROCEDURE TFailInfo.Success;
- PROCEDURE TFailInfo.Recover;
- END;
-
- A subclass which overrode CatchFailures would do its thing to remember state,
- then call INHERITED. Similarly, linkage between subclass and superclass could
- easily be set up for the other methods. This interface would allow C++ failure
- handling to operate the same way as Object Pascal failure handling. It would
- also be a lot easier to teach people. An interesting sidenote: the constructor
- in C++ could automatically call CatchFailures and the destructor Success.
- Thus, instantiation and registration could be combined into a single step.
-
- Food for thought.
-
- Jeff Alger
- Exis
- A Technology Firm of KPMG Peat Marwick
-
-